import request from '@/utils/request'

interface IRoleResp{
    list: IRole[]
}

// 获取所有角色信息
export const getAllRoles = () => request.get<any, IRoleResp>('/api/v1/admin/roles')

// 添加角色信息
export const addRole = (data: IRole) => request.post('/api/v1/admin/roles', data)

// 修改角色信息
export const updateRole = (data: IRole) => request.put('/api/v1/admin/roles/' + data.id, data)

// 删除角色信息
export const deleteRole = (id: string) => request.delete('/api/v1/admin/roles/' + id)